<?php
namespace common\models;

use Yii;

/**
 * This is the model class for table "goodsfile".
 *
 * @property integer $id
 * @property string $name
 * @property integer $pid
 */
class Goodsfile extends \yii\db\ActiveRecord
{

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'goodsfile';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [
                [
                    'pid'
                ],
                'required'
            ],
            [
                [
                    'pid'
                ],
                'integer'
            ],
            [
                [
                    'name'
                ],
                'file',
                'extensions' => 'jpg,gif,png'
            ]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => '副图',
            'pid' => '商品ID'
        ];
    }
}
